#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:homework5_3.py
# author:wmf
# datetime:2021/4/14 20:00
# software: PyCharm
'''
this is function description
'''
# import module your need

# 3  编写一个装饰器，为多个函数加上认证的功能（必须输入用户的账号密码，才能调用这个函数）


from datetime import datetime


def log_in(func):
    def inner(correct_num='admin', correct_password='123456'):
        num = input("请输入用户账号:")
        if correct_num == num:
            print("账号正确")
            password = input("请输入用户密码:")
            if correct_password == password:
                print("密码正确")
                func()
            else:
                print("密码错误")
        else:
            print("账号错误")
    return inner


def get_time():
    print(datetime.now().replace(microsecond=0))


get_time = log_in(get_time)
get_time()
